<?php

namespace App\Admin\Actions\Show;

use App\Admin\Forms\CustomerFollowupForm;
use App\Models\Customer;
use Dcat\Admin\Show\AbstractTool;
use Dcat\Admin\Widgets\Modal;

class CustomerFollowup extends AbstractTool
{
    /**
     * @return string
     */
	protected $title = '跟进';


    public function render()
    {
        $customer = Customer::query()->where('id',$this->getKey())->first();
        $params['id']       = $this->getKey();
        $params['level']    = $customer->level;
        $params['status']   = $customer->status;
        $form = CustomerFollowupForm::make($params);
        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($this->button());
    }

    public function button()
    {
        return '<div class="btn-group pull-right btn-mini" style="margin-right: 5px">
                    <a href="javascript:;" class="btn btn-sm btn-primary ">
                        <i class="feather icon-edit-1"></i><span class="d-none d-sm-inline">' . $this->title . '</span>
                    </a>
                </div>';
    }


}
